package com.hs.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hs.sfzy.entity.Consultant;
import com.hs.sfzy.mapper.ConsultantMapper;
import com.hs.sfzy.service.ConsultantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ConsultantServiceimpl
 * @Description TODO
 * @Author wangzhihao
 * @Date 2025年08月13日 10:51
 * @Version 1.0
 */
@Service
public class ConsultantServiceimpl implements ConsultantService {
    @Autowired
    private ConsultantMapper consultantMapper;
    @Override
    public int addConsultant(Consultant consultant) {
        return consultantMapper.addConsultant(consultant);
    }

    @Override
    public Consultant getConsultant(int id) {
        return consultantMapper.getConsultant(id);
    }

    @Override
    public PageInfo<Consultant> getConsultants(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Consultant> list = consultantMapper.getConsultants();
        PageInfo<Consultant> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public PageInfo<Consultant> getConsultantss(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Consultant> list = consultantMapper.getConsultantss();
        PageInfo<Consultant> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public List<Consultant> getByAll(Consultant consultant) {
        return consultantMapper.getByAll(consultant);
    }

    @Override
    public PageInfo<Consultant> getConlevtag(Consultant consultant, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Consultant> list =consultantMapper.getConlevtag(consultant);
        PageInfo<Consultant> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }


    @Override
    public List<Consultant> getConsultantsAndLevelAndTags(String levelName, String tag) {
        return consultantMapper.getConsultantsAndLevelAndTags(levelName,tag);
    }


}
